#include "diatariffs.h"
#include "ui_diatariffs.h"

DiaTariffs::DiaTariffs(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DiaTariffs)
{
    ui->setupUi(this);
    this->ui->btn_ok->setEnabled(false);
}

DiaTariffs::~DiaTariffs()
{
    delete ui;
}

void DiaTariffs::setTariffName(const QString &name){
    this->ui->le_tariff_name->setText(name);
}

QString DiaTariffs::getTariffName(){
    return this->ui->le_tariff_name->text();
}

void DiaTariffs::setTariffCost(int cost){
    this->ui->sb_cost->setValue(cost);
}

int DiaTariffs::getTariffCost(){
    return this->ui->sb_cost->value();
}

void DiaTariffs::slotValidateName(){
    if(this->ui->le_tariff_name->text().size() != 0){
        this->ui->btn_ok->setEnabled(true);
    }
}
